<?php
namespace app\process;

use support\Db;
use Workerman\Timer;

class TaskOneProcess
{
    public function onWorkerStart()
    {
        // 每隔10秒检查一次数据库是否有新用户注册
        Timer::add(10, function(){
            Db::table('users')->where('regist_timestamp', '>', time()-10)->get();
        });
    }
}